package 设计模式.行为型.策略;

/**
 * description:
 *
 * @author 颜真明
 * @date 2024/3/12  10:14
 */
public class TestStrategy {
    public static void main(String[] args) {
        StrategyContext context = new StrategyContext(new StrategyA());
        System.out.println("10 + 5 = " + context.executeStrategy(10, 5));

        context = new StrategyContext(new StrategyB());
        System.out.println("10 - 5 = " + context.executeStrategy(10, 5));

        context = new StrategyContext(new StrategyC());
        System.out.println("10 * 5 = " + context.executeStrategy(10, 5));
    }

}
